import math
class Solution(object):
    def minimizedMaximum(self, n, quantities):
        left = 1
        right = max(quantities)
        def cal(val):
            ans = 0
            for q in quantities:
                ans += math.ceil(q / val)
            return ans <= n
        while left < right:
            mid = (left + right) // 2
            if cal(mid):
                right = mid
            else:
                left = mid + 1
        return left